package com.tianqu.tms.www.cardect.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.tianqu.tms.core.base.Logger;
import com.tianqu.tms.core.base.TmsAction;
import com.tianqu.tms.core.base.UserContext;
import com.tianqu.tms.core.util.TmsConstants;
import com.tianqu.tms.www.cardect.controller.CarWDPersonNDInfoDetailController;
import com.tianqu.tms.www.cardect.viewhelper.CarNormalDetectViewHelper;
/**
 * 待检测（人工）列表页进入普通检测详细页Action
 * 
 * @author tianshifu
 *
 */
public class CarWDPersonNDInfoDetailAction extends TmsAction {
	private Logger logger = Logger.getLogger(CarWDPersonNDInfoDetailAction.class);//log
	private static final String BUTTONSHOW = "buttonShow";//控制按钮显隐

	@Override
	protected ActionForward doAction(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response,
			UserContext uc) throws Exception {
		logger.debug(this.getClass().getName() + "#execute was called.");
		
		CarWDPersonNDInfoDetailController controller = new CarWDPersonNDInfoDetailController();
		controller.execute(uc);
		
		CarNormalDetectViewHelper view = (CarNormalDetectViewHelper)uc.getAttribute(TmsConstants.VIEWHELP);
		
		view.setButtonShow((String)uc.getAttribute(BUTTONSHOW));
		uc.removeAttribute(BUTTONSHOW);
		
		request.setAttribute(TmsConstants.VIEWHELP, view);//将检测信息打到前台
		//uc.removeAttribute(TmsConstants.VIEWHELP);//这个需要进入下个页面再进行删除
		logger.debug(this.getClass().getName() + "#doAction was completed.");
		return mapping.findForward(TmsConstants.SUCCESS); 
	}

}
